package light.head.model;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import org.hibernate.annotations.Formula;
/**
 * 用车记录
 *
 */
@Entity
@Table
public class VehicleRecord implements Serializable {
	

	private static final long serialVersionUID = -8438054598924541651L;
	
	
	private Integer code;
	private String plate;						//车牌号
	private Integer vu;							//用车人
	private Date vt;							//用车时间
	private Date forecast;						//预计归还时间
	private Boolean remand;						//是否归还
	private Integer cu;							//创建人编号
	private Date ct;							//创建时间
	private String name;						//归还确认人
	private Date time;							//确认时间
	private Boolean deledte;					//是否删除
	private String cn;							//创建时间
	private Integer route;						//用车行驶公里
	
	
	
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column
	public Integer getCode() {
		return code;
	}
	@Column
	public Integer getVu() {
		return vu;
	}
	@Column
	public Date getVt() {
		return vt;
	}
	@Column
	public Date getForecast() {
		return forecast;
	}
	@Column
	public Boolean getRemand() {
		return remand;
	}
	@Column
	public Boolean getDeledte() {
		return deledte;
	}
	@Column
	public String getPlate() {
		return plate;
	}
	@Column
	public Integer getCu() {
		return cu;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable = false, nullable = false)
	public Date getCt() {
		return ct;
	}
	@Column
	public String getName() {
		return name;
	}
	@Temporal(TemporalType.TIMESTAMP)
	@Column(updatable = false, nullable = false)
	public Date getTime() {
		return time;
	}
	@Formula("(SELECT u.realName FROM UserInfo u WHERE u.code = cu)")
	public String getCn() {
		return cn;
	}
	@Column
	public Integer getRoute() {
		return route;
	}
	
	
	
	
	
	
	public void setRoute(Integer route) {
		this.route = route;
	}
	public void setPlate(String plate) {
		this.plate = plate;
	}
	public void setCu(Integer cu) {
		this.cu = cu;
	}
	public void setCt(Date ct) {
		this.ct = ct;
	}
	public void setName(String name) {
		this.name = name;
	}
	public void setTime(Date time) {
		this.time = time;
	}
	public void setCn(String cn) {
		this.cn = cn;
	}
	public void setDeledte(Boolean deledte) {
		this.deledte = deledte;
	}
	public void setCode(Integer code) {
		this.code = code;
	}
	public void setVu(Integer vu) {
		this.vu = vu;
	}
	public void setVt(Date vt) {
		this.vt = vt;
	}
	public void setForecast(Date forecast) {
		this.forecast = forecast;
	}
	public void setRemand(Boolean remand) {
		this.remand = remand;
	}
	

}
